#include <iostream>
#include <string>

using namespace std;

class Solution {
public:
    int lengthOfLastWord(string s) {
		int len = s.size();
		int i = 0;
		while(s[len-1] == ' '){
			len--;
		}
        while(len > 0 && s[len-1] != ' '){
			i++;
			len--;
		}
		return i;
    }
};

int main(){
	
}